﻿using System;
using System.Collections.Generic;
using System.Text;
using TarreOA.TarreOADAL;
using TarreOA.TarreOAModels;

namespace TarreOA.TarreOABLL
{
    public class DiscussThemeCommentstbService
    {
        /// <summary>
        /// 将主题评论保存到数据库中
        /// </summary>
        /// <param name="dtCContent"></param>
        /// <param name="dtCCreateTime"></param>
        /// <param name="dtCCUser"></param>
        /// <param name="dtId"></param>
        /// <returns></returns>
        public int SaveDtCommentsInfo(string dtCContent, DateTime dtCCreateTime, int dtCUser, int dtId)
        {
            DiscussThemeCommentstbDAO dtcDAO = new DiscussThemeCommentstbDAO();
            return dtcDAO.SaveDtCommentsInfo(dtCContent, dtCCreateTime, dtCUser, dtId);
        }

         /// <summary>
        /// 根据主题编号查找该主题的所有评论
        /// </summary>
        /// <param name="dtId"></param>
        /// <returns></returns>
        public List<DiscussThemeCommentstb> FindALLByDtId(int dtId)
        {
            DiscussThemeCommentstbDAO dtcDAO = new DiscussThemeCommentstbDAO();
            return dtcDAO.FindALLByDtId(dtId);
        }

        /// <summary>
        /// 根据主题编号查找该主题发表的最后评论信息
        /// </summary>
        /// <param name="dtId"></param>
        /// <param name="lastReadTime"></param>
        /// <returns></returns>
        public DiscussThemeCommentstb FindTheOneByLastReadTime(int dtId)
        {
            DiscussThemeCommentstbDAO dtcDAO = new DiscussThemeCommentstbDAO();
            return dtcDAO.FindTheOneByLastReadTime(dtId);
        }
    }
}
